class Solution:
    """
    字符串轮转。给定两个字符串s1和s2，请编写代码检查s2是否为s1旋转而成（比如，waterbottle是erbottlewat旋转后的字符串）。
    """

    def isFlipedString(self, s1: str, s2: str) -> bool:
        if len(s1) != len(s2): return False
        if len(s1) == len(s2) == 0: return True
        for j in range(len(s1)):
            if s2 == s1[j:] + s1[:j]:
                return True
        return False


if __name__ == '__main__':
    s = Solution()
    aaaaaa = "asd" + "aff"
    print(aaaaaa[:2])
    print(s.isFlipedString("asd", "sda"))
    print(s.isFlipedString("asd", "asd"))
    print(s.isFlipedString("a", "s"))
    print(s.isFlipedString("asds", "sda"))
